\section{Introduction to code}
The software is written in Python. A tree view of the source-code files:
\begin{verbatim}
.
|-- gui
|   |-- AiCompareGui.py
|   |-- AiGui.py
|   |-- bookGui.glade
|   `-- compareBlobs.glade
|-- imageFeatures_classes
|   |-- AiBlob.py
|   |-- AiBook.py
|   |-- AiImage.py
|   `-- AiPage.py
|-- informationExtraction_modules
|   `-- AiNamedEntity.py
`-- reasoning
    `-- AiReasoning.py
\end{verbatim}
Here, the main purpose of each source file is explained:
\begin{itemize}
\item \texttt{AiGui.py} Main GUI based on PyGTK. Run with
  \texttt{python AiGui.py}.
\item \texttt{bookGui.glade} XML declaration of main GUI.
\item \texttt{AiGui.py} GUI dialogue for comparing blobs.
\item \texttt{compareBlobs.glade} XML declaration of comparing blobs
  dialogue.
\item \texttt{AiBook.py} A book consists of pages. Contains code for
  loading books from XML. Control interface for GUI.
\item \texttt{AiPage.py} A page can have an image, blobs, text and
  keywords.  Contains code for drawing blobs and name-tags on the
  images.
\item \texttt{AiImage.py} Class for storing open-cv images and
  converting them to a format that can be displayed by the GUI.
\item \texttt{AiBlob.py} Contains all code for finding blobs in
  images, extracting and comparing features.
\item \texttt{AiNamedEntity.py} Module containing functions for
  part-of-speech tagging.
\item \texttt{AiReasoning.py} The reasoning system for creating
  relations between blobs (and images) and words.
\end{itemize}

\begin{comment}
Possibly include segments of code you consider significant (solving
a hard problem, or just neat stuff).
\end{comment}

\begin{comment}
\lstset{
language=python,
basicstyle=\ttfamily\small,
otherkeywords={1, 2, 3, 4, 5, 6, 7, 8 ,9 , 0, -, =, +, [, ], (, ), \{, \}, :, *, !},
keywordstyle=\color{blue},
stringstyle=\color{red},
showstringspaces=false,
emph={class, pass, in, for, while, if, is, elif, else, not, and, or,
def, print, exec, break, continue, return, def},
emphstyle=\color{black}\bfseries,
emph={[2]True, False, None, self},
emphstyle=[2]\color{key},
emph={[3]from, import, as},
emphstyle=[3]\color{blue},
morecomment=[s]{"""}{"""},
commentstyle=\color{gray}\slshape,
rulesepcolor=\color{blue}
}

\begin{lstlisting}
def threshold(img, method):
        edge = cvCreateImage(cvSize(img.width, img.height), 8, 1)       
        cvThreshold(img, edge, 220, 255, method)
        return edge
\end{lstlisting}
\end{comment}
